// request.js
import axios from 'axios';
import JSONBIG from "json-bigint";
axios.defaults.transformResponse = [
    function (data) {
        const json = JSONBIG({
            storeAsString: true,
        });
        const res = json.parse(data);
        return res;
    },
];
const apiClient = axios.create({
    baseURL: 'https://v3.api.8080bl.com',
    // baseURL: 'http://120.79.157.155:9500',
    headers: {
        Accept: 'application/json',
    }
});

// 请求拦截器
apiClient.interceptors.request.use(
    config => {
        // 在这里添加任何请求前需要执行的操作
        return config;
    },
    error => {
        return Promise.reject(error);
    }
);

// 响应拦截器
apiClient.interceptors.response.use(
    response => {
        return response;
    },
    error => {
        return Promise.reject(error);
    }
);

export default apiClient;
